const express = require('express');
const operation = require('../controller/operation')
const router = express.Router();
// 获取当前用户数量
router.get('/total',(req,res)=>{
       let type = req.query.type;
       operation.getTotal(type).then(result=>{
        res.json({
            status:200,
            data:result[0].total,
            msg:`获取${type}的总量`
        })
       },err=>{
        res.json({
            status:400,
            msg:'获取失败'
        })
       })
})

module.exports = router;